package com.example.commuity.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import androidx.fragment.app.FragmentStatePagerAdapter

class CommunityPageAdapter constructor(fm: FragmentManager,private val fragments :ArrayList<Fragment>,behavior : Int): FragmentPagerAdapter(fm, behavior) {

    private val tablist = arrayListOf("推荐","关注")

    override fun getCount(): Int =fragments.size

    override fun getItem(position: Int): Fragment =fragments[position]

    override fun getPageTitle(position: Int): CharSequence? {
        return tablist[position]
    }

}